package com.heima.user.controller;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.dtos.UserRelationDto;
import com.heima.user.service.ApUserFollowService;
import com.heima.utils.thread.ApThreadLocalUtil;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("api/v1/user")
public class ApUserFollowController {
    @Autowired
    private ApUserFollowService apUserFollowService;

    /**
     * 用户的关注行为
     *
     * @param userRelationDto
     * @return
     */
    @PostMapping("/user_follow")
    @ApiOperation("用户的关注行为")
    public ResponseResult userFollow(@RequestBody UserRelationDto userRelationDto) {
        log.info("用户的关注行为：{}", userRelationDto);
        return apUserFollowService.userFollow(userRelationDto);
    }
}
